﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Xml.Serialization;
using Core.Domain.Entities;
using Core.Interfaces;

namespace DataXml.CommunityFiles
{
  /// <summary>
  ///   Representation of an XML file
  /// </summary>
  /// <example>
  ///   <Community Name = "Sample Community" xsi:noNamespaceSchemaLocation = "community.xsd" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance">
  ///     <Person LName = "Accorti" VotingEligibility = "Eligible" FName = "Pónt" AKAName = "Paul" AgeGroup = "Pre-Youth" Voted = "No"></Person></Community>
  /// </example>
  //[XmlRoot("Community")]
  [DataContract(Namespace=".")]
  public class Community : ICommunity
  {
    private readonly List<Person> _people;

    public Community()
    {
      _people = new List<Person>();
    }

    ///<summary>People in the community
    ///</summary>
    ///<exception cref="NotImplementedException"></exception>
    //[XmlIgnore]
    public IList<Person> People
    {
      get
      {
        return _people;
      }
    }

    ///<summary>Community Name
    ///</summary>
    //[XmlAttribute(AttributeName = "Name")]
    public string Name { get; set; }
  }
}